import {store} from "../store";
export const mapState = (arr) => { // ['a','b']
  let tmp = {};
  for(let i = 0; i < arr.length; i++) {
    tmp[arr[i]] = () => store.state[arr[i]];
  }
  return tmp;
};
export const mapGetters = (arr) => { // ['a','b']
  let tmp = {};
  for(let i = 0; i < arr.length; i++) {
    tmp[arr[i]] = () => store.getters[arr[i]];
  }
  return tmp;
};
export const mapMutations = (arr) => { // ['a','b']
  let tmp = {};
  for(let i = 0; i < arr.length; i++) {
    tmp[arr[i]] = () => store.commit(arr[i]);
  }
  return tmp;
};
export const mapActions = (arr) => { // ['a','b']
  let tmp = {};
  for(let i = 0; i < arr.length; i++) {
    tmp[arr[i]] = () => store.dispatch(arr[i]);
  }
  return tmp;
};
